<?php
class RegisterData_Data {
	
	private $db;
	
	public function __construct(){
		$this->db = new MysqlImproved_Driver();
	}
	
	public function registerUser($realname, $email, $username, $password){
		
		$this->db->connect();
		
		$realname = $this->db->escape($realname);
		$email = $this->db->escape($email);
		$username = $this->db->escape($username);
		$password = $this->db->escape($password);

		$this->db->prepare(
				"
				INSERT 
				INTO
				users(
				username,
				password,
				email,
				realname,
				banned,
				access_level
				)
				VALUES(
				'$username',
				'$password',
				'$email',
				'$realname',
				1,
				1
				);
				"
				);
		$this->db->query();
		return $this->db->insert();
	}
}